package openbang.account.service.vo;

/**
 * 消息处理服务
 * 
 * 调用后台服务的一些返回值的状态定义
 * 
 * @author aibo zeng
 *
 */

public enum MsgServiceEnum {
	OK (0,"成功"),//删除、新建等
	NOEXIST(1,"消息不存在"),
	NOAUTH(2,"没有发消息的权限"),
	ERR_EMAIL(3,"收件人的邮件地址不存在");
	

	private Integer code;
	private String desc;
	
	private MsgServiceEnum(Integer code,String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public String getDesc(){
		return desc;
	}
	
	public static String getDesc(Integer code) {
		for(MsgServiceEnum each : MsgServiceEnum.values()) {
			if(each.getCode()==code)
				return each.getDesc();
		}		
		return "";
	}
}
